<?php

namespace App\service;
use EasySwoole\EasySwoole\Config;
use App\service\MyQueue;
use EasySwoole\Component\Process\AbstractProcess;
use EasySwoole\Queue\Job;
use App\Models\UserModel;
use App\Models\Assign;
use App\Models\Project;


class QueueProcess extends AbstractProcess
{

    protected function run($arg)
    {
        // TODO: Implement run() method.
        go(function (){
            MyQueue::getInstance()->consumer()->listen(function (Job $job){
                $id = $job->getJobData();
                $item = Project::create()->get(['id'=>$id,'status'=>1]);
                if(empty($item)){
                    echo "error item found...";
                }else{
                    \App\service\Exptser::selectexpt($item); 
                }
            });
        });
    }
}
